package thread;

public class RunnableDemo {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println("hello world");
                }
            }
        };

        Thread t2 = new Thread(()->{
            for (int i = 0; i < 5; i++) {
                System.out.println("你好，世界");
            }
        });

        t1.start();
        t2.start();
    }
}
//class Run1 implements Runnable{
//    @Override
//    public void run() {
//        for (int i = 0; i < 5; i++) {
//            System.out.println("hello world");
//        }
//    }
//}
//
//class Run2 implements Runnable{
//    @Override
//    public void run() {
//        System.out.println("线程2开始了");
//    }
//}